@extends('admin.admin')

@section('content')
        <!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        属性值管理
        <small>属性值列表</small>
        <small>分类属性值</small>
        <small>添加属性值</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="/admin"><i class="fa fa-dashboard"></i> 控制面板</a></li>
        <li ><a href="/admin/category">分类管理</a></li>
        <li ><a href="/admin/category/category_attribute/{{$cat_id}}">属性管理</a></li>
        <li ><a href="/admin/category_attribute/category_attribute_value?cat_id={{$cat_id}}&category_attribute_id={{$category_attribute_id}}">属性值管理</a></li>
        <li class="active">添加属性值</li>
    </ol>
</section>

<!-- Main content -->
<section class="content">

    <div class="row">
        <div class="col-xs-12">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">添加属性值</h3>
                    <div class="pull-right">
                        <a href="/admin/category_attribute/category_attribute_value?cat_id={{$cat_id}}&category_attribute_id={{$category_attribute_id}}" type="button" class="btn btn-block btn-success btn-xs"><i class="icon  glyphicon glyphicon glyphicon-menu-left"></i> 返回</a>
                    </div>
                </div>
                <!-- /.box-header -->
                <!-- form start -->
                {!! Form::model($categoryAttributeValue,['route'=>['admin.categoryAttributeValue.store'],'method'=>'POST','class'=>'form-horizontal'])  !!}
                    {!! Form::hidden('back_url',@$_SERVER['HTTP_REFERER']) !!}
                    {!! Form::hidden('category_attribute_id', $category_attribute_id) !!}
                    <div class="box-body">

                        <div class="form-group @if($errors->has('attribute_value')) has-error   @endif">
                            <label for="exampleInputPassword1" class="col-sm-2 control-label">属性值</label>
                            <div class="col-sm-3">
                                {!! Form::text('attribute_value',old('attribute_value'),array('class'=>'form-control','placeholder'=>'请填写属性值'))!!}
                                @if($errors->has('attribute_value'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('attribute_value')}}</label>
                                @elseif(Session::has('message'))
                                    <label class="control-label" style="color: red" for="inputError"><i class="fa fa-times-circle-o" style="color: red"></i> {{Session::get('message')}}</label>
                                @endif
                            </div>
                        </div>

                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <div class="form-group no-padding">
                            {!! Form::hidden('_method', 'POST') !!}
                            <label class="col-sm-2 control-label">&nbsp;</label>
                            <div class="col-sm-3">
                                <button type="submit" class="btn btn-primary">保存</button>
                            </div>
                        </div>
                    </div>
                {!! Form::close()  !!}
            </div>
            <!-- /.box -->
        </div>
    </div>



</section>
<!-- /.content -->

<!-- Select2 -->
<script type="text/javascript" src="{{ asset("/components/AdminLTE/plugins/select2/select2.full.min.js") }}"></script>
<script>
    //Initialize Select2 Elements
    $(".select2").select2();
</script>
@endsection